<?php

namespace App\Common\Lib\Com\Kafka;

use App\Common as com;
use App\Common\Lib\Com\Kafka\Consumer as thisConsumer;
use longlang\phpkafka\Consumer\Consumer as kafkaConsumer;
use longlang\phpkafka\Consumer\ConsumerConfig;
use longlang\phpkafka\Consumer\ConsumeMessage;

class Consumer extends kafkaConsumer {

	use com\Cla\ClaBase\Traits\Make;

	// ===============================
	//
	//
	// 下面为静态方法
	//
	//
	// ===============================

	/**
	 * @param ConsumerConfig $productConfig
	 * @return $this
	 */
	public static function makeOfNew( ConsumerConfig $productConfig ):self {
	    return self::make( $productConfig );
	}

	/**
	 * @return static
	 */
	public static function newOfDefault():self {
		$config = new ConsumerConfig();
		$config->setBroker( '192.168.147.128:9092' );
		//
		return self::make( $config );
	}

}
